<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@taglib uri="/typeUtil"  prefix="typeUtil"%>
    <%@taglib uri="/dateUtil"  prefix="dateUtil"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>续住页面</title>
<!-- Date Picker -->
<link rel="stylesheet" href="/hotel/visitor/css/bootstrap-datepicker.min.css">
</head>
<body>
	<!-- 续住信息输入框 -->
	<div role="tabpanel" class="tab-pane" id="chan">
		<div id="reserveInforDiv" style="padding: 50px 0;margin-top: 50px;background-color: #fff; text-align: right;width: 420px;margin: 50px auto;">
			<div class="form-horizontal">
				<input id="checkInId" type='hidden' value='${checkIn.id }'>
				<div class="form-group">
					<label for="" class="col-xs-4 control-label">房间类型:</label>
					<div class="col-xs-5">
						<label  class="col-xs-10 control-label">${typeUtil:getTypeName(room.typeId)}</label>
					</div>
				</div>
				<div class="form-group">
					<label for="" class="col-xs-4 control-label">房间名称:</label>
					<div class="col-xs-5">
						<label class="col-xs-10 control-label">${room.name}</label>
					</div>
				</div>
				<div class="form-group">
					<label for="" class="col-xs-4 control-label">单价:</label>
					<div class="col-xs-5">
						<label class="col-xs-10 control-label">${typeUtil:getTypePrice(room.typeId)*room.discount/100.0 }元/日</label>
					</div>
				</div>
				<div class="form-group">
					<label for="" class="col-xs-4 control-label">当前总费用:</label>
					<div class="col-xs-5">
						<label class="col-xs-10 control-label">${checkIn.cost }</label>
					</div>
				</div>
				<div class="form-group">
					<label for="" class="col-xs-4 control-label">入住时间:</label>
						<div class="col-xs-5">
							<label class="col-xs-10 control-label">${dateUtil:datetime2str(checkIn.inTime) }</label>
						</div>
				</div>
				<div class="form-group">
					<label for="" class="col-xs-4 control-label">当前退房时间:</label>
						<div class="col-xs-5">
							<label class="col-xs-10 control-label">${dateUtil:datetime2str(checkIn.outTime) }</label>
						</div>
				</div>
				<div class="form-group">
					<label for="" class="col-xs-4 control-label">新的退房时间:</label>
						<div class="col-xs-5">
							<input type="text" class="form-control"  id="date-start">
						</div>
				</div>
				<div class="form-group">
					<label for="reservePass" class="col-xs-4 control-label">备注:</label>
						<div class="col-xs-5">
							<textarea class="form-control input-sm duiqi" cols='20' rows='20' id='resComment'></textarea>
						</div>
				</div>
				<div class="form-group text-right">
					<div class="col-xs-offset-4 col-xs-5" style="margin-left: 169px;">
						<button  class="btn btn-xs btn-green" id='continueBut'>续住</button>
						<button  class="btn btn-xs btn-white" id='onCancelBut' onclick="jump('/hotel/checkIn/checkInList')">取消</button>
					</div>
				</div>
			</div>>
		</div>
	</div>
</body>
<!-- Date Picker -->

<script src="/hotel/visitor/js/jquery-2.1.4.min.js"></script>
<script src="/hotel/visitor/js/superfish.js"></script>
<script src="/hotel/visitor/js/jquery.waypoints.min.js"></script>
<script src="/hotel/visitor/js/jquery.countTo.js"></script>
<script src="/hotel/visitor/js/jquery.stellar.min.js"></script>
<script src="/hotel/visitor/js/jquery.flexslider-min.js"></script>
<script src="/hotel/visitor/js/bootstrap-datepicker.min.js"></script>
<script src="/hotel/visitor/js/custom.js"></script>
<script type="text/javascript" src="/hotel/js/timeUtil.js"></script>
<script type="text/javascript">
	$('#continueBut').click(function(){
		outDate=getStandardDate($("#date-start").val())
		//alert(outDate)
		data={'checkId':$('#checkInId').val(),'newOutDate':outDate}
		$.post('/hotel/continueBook/checkContinue.do',data,function(str){
			var res=eval('(' +str + ')')
			if(res.code!=0){
				alert(res.message)
				return;
			}
			if(!confirm('续住共需'+res.object+'元，您确定续住吗？'))
				return 
			data={'checkId':$('#checkInId').val(),'newOutDate':outDate,"zcomment":$('#zcomment').val()}
			//alert(JSON.stringify(data))
			$.post('/hotel/continueBook/continueBook.do',data,function(str){
				var res=eval('(' +str + ')')
				if(res.code!=0){
					alert(res.message)
					return;
				}
				window.location.href="/hotel/system/mainPage"
			})
		})
	})
</script>
</html>